home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgramD2.iso
/
Borland
/
Borland C++ V5.02
/
QUEUETST.PAK
/
QUEUETST.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-06
|
2KB
|
61 lines
/*------------------------------------------------------------------------*/
/* */
/* QUEUETST.CPP */
/* */
/* Copyright (c) 1991, 1993 Borland International */
/* All Rights Reserved. */
/* */
/* TQueue example file */
/* */
/*------------------------------------------------------------------------*/
#ifndef __CLASSLIB__TIME_H__
#include "classlib\time.h"
#endif // __LTIME_H
#ifndef __QUEUES_H
#include "classlib\queues.h"
#endif // __QUEUE_H
#ifndef __IOSTREAM_H
#include <iostream.h>
#endif
#ifndef __DOS_H
#include <dos.h>
#endif
#ifndef __STDLIB_H
#include <stdlib.h>
#endif
int main()
{
randomize();
TQueue<TTime> TimeLine;
cout << "\nSampling";
for( int i = 0; i < 7; i++ )
{
TTime SnapShot;
TimeLine.Put( SnapShot );
cout << ".";
int k = rand();
for(int j = 0; j < k; ++j ) // Delay loop
{
cout << "";
cout << "";
cout << "";
}
}
cout << "\nThe timing samples are:\n\n";
while( !TimeLine.IsEmpty() )
{
TTime SampleTime = TimeLine.Get();
cout << SampleTime << "\n";
}
return 0;
}